from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union, overload

T = TypeVar('T')
F = TypeVar('F', bound=Callable[..., Any])

class Celery:
    def __init__(
        self,
        main: Optional[str] = None,
        broker: Optional[str] = None,
        backend: Optional[str] = None,
        **kwargs: Any
    ) -> None: ...
    
    def task(
        self,
        func: Optional[F] = None,
        **options: Any
    ) -> Union[Callable[[F], F], F]: ...
    
    def on_after_configure(self, **kwargs: Any) -> Callable[[F], F]: ...
    
    def on_after_finalize(self, **kwargs: Any) -> Callable[[F], F]: ...
    
    def add_periodic_task(
        self,
        schedule: Any,
        sig: Any,
        name: Optional[str] = None,
        **kwargs: Any
    ) -> None: ...
    
    def conf(self) -> Any: ...
    
    def start(self) -> None: ...
    
    def worker_main(self, argv: Optional[List[str]] = None) -> Any: ...
    
    def send_task(
        self,
        name: str,
        args: Optional[List[Any]] = None,
        kwargs: Optional[Dict[str, Any]] = None,
        **options: Any
    ) -> Any: ...

def shared_task(
    func: Optional[F] = None,
    **options: Any
) -> Union[Callable[[F], F], F]: ...

class Task:
    def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
    
    def delay(self, *args: Any, **kwargs: Any) -> Any: ...
    
    def apply_async(
        self,
        args: Optional[List[Any]] = None,
        kwargs: Optional[Dict[str, Any]] = None,
        **options: Any
    ) -> Any: ...
    
    def retry(
        self,
        exc: Optional[Exception] = None,
        throw: bool = True,
        eta: Optional[Any] = None,
        countdown: Optional[int] = None,
        max_retries: Optional[int] = None,
        **options: Any
    ) -> Any: ...

class AsyncResult:
    def get(
        self,
        timeout: Optional[float] = None,
        propagate: bool = True,
        interval: float = 0.5
    ) -> Any: ...
    
    def wait(
        self,
        timeout: Optional[float] = None,
        interval: float = 0.5
    ) -> Any: ...
    
    @property
    def state(self) -> str: ...
    
    @property
    def status(self) -> str: ...
    
    @property
    def result(self) -> Any: ...
    
    @property
    def successful(self) -> bool: ...
    
    @property
    def failed(self) -> bool: ...
    
    @property
    def ready(self) -> bool: ...

class Beat:
    def __init__(self, app: Celery, **kwargs: Any) -> None: ...
    
    def start(self) -> None: ...

class Worker:
    def __init__(self, app: Celery, **kwargs: Any) -> None: ...
    
    def start(self) -> None: ...

class schedules:
    class crontab:
        def __init__(
            self,
            minute: str = '*',
            hour: str = '*',
            day_of_week: str = '*',
            day_of_month: str = '*',
            month_of_year: str = '*',
            **kwargs: Any
        ) -> None: ...
    
    class schedule:
        def __init__(self, run_every: Any, **kwargs: Any) -> None: ...
    
    class solar:
        def __init__(self, event: str, lat: float, lon: float, **kwargs: Any) -> None: ...
